package com.example.com.skills_utf8;

import android.app.Fragment;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RectShape;
import android.graphics.drawable.shapes.Shape;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.app.BaseFragment;
import com.app.util.Utils;
import com.example.com.skills_utf8.R;


//
public class _64Fragment extends Fragment {


    private final String TAG = _64Fragment.class.getSimpleName();


    LinearLayout layout_progress, layout_b, bar_container;



    _64CircleProgress progress_cicle;
    Handler handler = new Handler();


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {


        View view = inflater.inflate(R.layout.fragment_64, container, false);


        layout_progress = (LinearLayout)view.findViewById(R.id.layout_progress);
        progress_cicle = (_64CircleProgress)view.findViewById(R.id.progress_cicle);
        progress_cicle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                progress_cicle.click();
            }
        });
        progress_cicle.setMax(360);


        Shape shape_rect = new RectShape();
        ShapeDrawable drawable = new ShapeDrawable( shape_rect );
        drawable.setIntrinsicWidth(500);
        drawable.setIntrinsicHeight(500);
        drawable.setAlpha(64);
        layout_progress.setBackgroundDrawable(drawable);

        handler.postDelayed( new MyRunnable(), 1000 );




        return view;

    }

    int count = 1;

    class MyRunnable implements Runnable {



        @Override
        public void run() {

            count %=360;
     //       Log.d(TAG, "count: "+count);
            progress_cicle.setProgress(count++);
            progress_cicle.invalidate();
            handler.postDelayed(new MyRunnable(), 100);

        }
    }






}
